<template>
	<view>
		<an-nav-bar title="附近门店"> </an-nav-bar>
		<view class="list">
			<view class="item" v-for="(item,index) in technicianList" :key="index"  @click="gotoUrl(item)">
				<view class="top flex">
					<view class="left">
						<image v-if="item.mainImg" :src="$common.binImage(item.mainImg)" mode=""></image>
						<image v-if="item.headImg" :src="$common.binImage(item.headImg)" mode=""></image>
					</view>
					<view class="right">
						<view class="name">{{item.storeName || item.nickName}}</view>
						<view class="address">{{item.address || '未设置地址'}}</view>
						<view class="distance flex">
							<span>距离您{{ item.distance || '9999'}}km</span>
						</view>
						<view class="num">213人去过</view>
					</view>
				</view>
				<!-- <view class="line flex">
					<view class="left flex">
						<view class="uni-label-pointer">百亿补贴</view>
					</view>
					<view class="right flex arrow">
						<span class="span1">88元</span>
						<span class="span2">128元</span>
						<span class="span3">精品足道</span>
					</view>
				</view>
				<view class="line flex">
					<view class="left flex">
						<view class="uni-label-pointer">百亿补贴</view>
					</view>
					<view class="right flex arrow">
						<span class="span1">88元</span>
						<span class="span2">128元</span>
						<span class="span3">精品足道</span>
					</view>
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				technicianList: []
			};
		},
		onLoad() {
			this.getStoreList();
		},
		methods: {
			gotoUrl(item) {
				uni.navigateTo({
					url: '/pages/storeDetail/storeDetail?id=' + item.accountId
				})
			},
			getStoreList() {
				let {
					location
				} = this.$mStore.state
				
				this.$http.get('/appNoAuth/store/massageTechnician/listOfflineStore', {
					latitude: location.latitude,
					longitude: location.longitude
				}).then(res => {
					this.technicianList = res.rows
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.list {
		display: block;

		.item {
			border-bottom: 10rpx solid #f8f8f8;

			.line {
				.left {
					justify-content: flex-end;
					width: 246rpx;
					padding-right: 20rpx;
					box-sizing: border-box;

					.uni-label-pointer {
						background: linear-gradient(90deg, #ff6251, #ffab7f);
						border-radius: 5px;
						color: #fff;
						width: 120rpx;
						height: 40rpx;
						line-height: 40rpx;
						text-align: center;
						font-size: 22rpx;
					}
				}

				.right {
					height: 60rpx;
					border-bottom: 2rpx solid #eee;
					font-size: 22rpx;
					color: #999;
					flex: 1;

					&::after {
						content: "";
						display: block;
						width: 4px;
						height: 6px;
						background: url(/static/arrow-r.png) no-repeat;
						background-size: 100% auto;
						margin-left: 10px;
					}

					&::before {
						content: "";
						display: block;
						width: 30rpx;
						height: 30rpx;
						background: url(/static/bao.png) no-repeat;
						background-size: 100% auto;
						margin-right: 8rpx;
					}
				}

				.span1 {
					color: #e02020;
					width: 82rpx;
				}

				.span2 {
					width: 82rpx;
					text-decoration: line-through;
				}

				.span3 {
					width: 234rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
				}
			}

			.top {
				padding-top: 20rpx;

				.left {
					padding: 0 20rpx 0 26rpx;

					image {
						width: 200rpx;
						height: 200rpx;
						background: #fff;
						box-shadow: 0 0 4rpx 0 rgba(0, 0, 0, .1);
						border-radius: 10rpx;
					}
				}

				.right {
					color: #333;
					border-bottom: 2rpx solid #eee;
					flex: 1;

					.name {
						font-size: 20rpx;
						font-weight: 700;
						margin-bottom: 10rpx;
						width: 480rpx;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}

					.address {
						font-size: 26rpx;
						margin-bottom: 10rpx;
						width: 480rpx;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}

					.distance {
						color: #666;
						font-size: 24rpx;
						margin-bottom: 14rpx;

						&::before {
							display: block;
							content: "";
							width: 20rpx;
							height: 24rpx;
							background: url(/static/weizhi.png) no-repeat;
							background-size: 100% auto;
							margin-right: 10rpx;
						}
					}

					.num {
						display: inline-block;
						min-width: 128rpx;
						padding: 0 10rpx;
						height: 40rpx;
						line-height: 40rpx;
						background: linear-gradient(270deg, #fcf8f3, #ffece8 48%, #f8efe3);
						border-radius: 10rpx;
						text-align: center;
						color: #dd6d56;
						font-size: 20rpx;
						margin-bottom: 14rpx;
					}
				}
			}
		}
	}
</style>
